package HLCode;

import HLLib.io.HLPackage;
import HLLibClasses.*;

public class HLClassManager implements HLClassManager_H {

    private HLClass[][] LibClassGroups = null;

    HLCustomClass[] CustomClassGroup = null;

    public HLClassManager() {
        HLPackage hlc = new HLPackage();
        hlc.Load1("hlc.pak");
        CustomClassGroup = new HLCustomClass[hlc.GetLength()];
        for (int i = 0; i < hlc.GetLength(); i++) {
            CustomClassGroup[i] = new HLCustomClass(this, i);
            CustomClassGroup[i].Load(hlc.GetFile(i));
        }

        LibClassGroups = new HLClass[][] { //
                new HLClass[LIB_CLASS_ADDRESSBOOK_COUNT],//
                new HLClass[LIB_CLASS_BASE_COUNT],//
                new HLClass[LIB_CLASS_CONTROL_COUNT],//
                new HLClass[LIB_CLASS_DEVICE_COUNT],//
                new HLClass[LIB_CLASS_GAME_COUNT],//
                new HLClass[LIB_CLASS_HANDFERE_COUNT],//
                new HLClass[LIB_CLASS_HTTP_COUNT],//
                new HLClass[LIB_CLASS_IO_COUNT],//
                new HLClass[LIB_CLASS_JSON_COUNT],//
                new HLClass[LIB_CLASS_MAP_COUNT],//
                new HLClass[LIB_CLASS_NOTIFICTION_COUNT],//
                new HLClass[LIB_CLASS_P2P_COUNT],//
                new HLClass[LIB_CLASS_PLATFORM_COUNT],//
                new HLClass[LIB_CLASS_PURCHASE_COUNT],//
                new HLClass[LIB_CLASS_SOCIAL_COUNT],//
                new HLClass[LIB_CLASS_SOCKET_COUNT],//
                new HLClass[LIB_CLASS_UI_COUNT],//
                new HLClass[LIB_CLASS_USERCONTROL_COUNT],//
        };
    }

    public HLClass GetLibClass(int libIndex, int index) {
        HLClass[] libClassGroup = LibClassGroups[libIndex];
        if (libClassGroup[index] == null) {
            switch (libIndex) {
            case CLASS_GROUP_TYPE_LIB_ADDRESSBOOK: {
                switch (index) {
                case LIB_CLASS_ADDRESSBOOK_AddressBook: {
                    libClassGroup[index] = new HLClassAddressBook(this);
                    break;
                }
                case LIB_CLASS_ADDRESSBOOK_AddressPerson: {
                    libClassGroup[index] = new HLClassAddressPerson(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_BASE: {
                switch (index) {
                case LIB_CLASS_BASE_AppConfig: {
                    libClassGroup[index] = new HLClassAppConfig(this);
                    break;
                }
                case LIB_CLASS_BASE_AppSetting: {
                    libClassGroup[index] = new HLClassAppSetting(this);
                    break;
                }
                case LIB_CLASS_BASE_ByteList: {
                    libClassGroup[index] = new HLClassByteList(this);
                    break;
                }
                case LIB_CLASS_BASE_CharList: {
                    libClassGroup[index] = new HLClassCharList(this);
                    break;
                }
                case LIB_CLASS_BASE_Collection: {
                    libClassGroup[index] = new HLClassCollection(this);
                    break;
                }
                case LIB_CLASS_BASE_Crc: {
                    libClassGroup[index] = new HLClassCrc(this);
                    break;
                }
                case LIB_CLASS_BASE_DateTime: {
                    libClassGroup[index] = new HLClassDateTime(this);
                    break;
                }
                case LIB_CLASS_BASE_Dictionary: {
                    libClassGroup[index] = new HLClassDictionary(this);
                    break;
                }
                case LIB_CLASS_BASE_FlurryAnalytics: {
                    libClassGroup[index] = new HLClassFlurryAnalytics(this);
                    break;
                }
                case LIB_CLASS_BASE_Graphics: {
                    libClassGroup[index] = new HLClassGraphics(this);
                    break;
                }
                case LIB_CLASS_BASE_Image: {
                    libClassGroup[index] = new HLClassImage(this);
                    break;
                }
                case LIB_CLASS_BASE_ImageInfo: {
                    libClassGroup[index] = new HLClassImageInfo(this);
                    break;
                }
                case LIB_CLASS_BASE_ImageManager: {
                    libClassGroup[index] = new HLClassImageManager(this);
                    break;
                }
                case LIB_CLASS_BASE_InputManager: {
                    libClassGroup[index] = new HLClassInputManager(this);
                    break;
                }
                case LIB_CLASS_BASE_Int: {
                    libClassGroup[index] = new HLClassInt(this);
                    break;
                }
                case LIB_CLASS_BASE_IntList: {
                    libClassGroup[index] = new HLClassIntList(this);
                    break;
                }
                case LIB_CLASS_BASE_IntListEncrypted: {
                    libClassGroup[index] = new HLClassIntListEncrypted(this);
                    break;
                }
                case LIB_CLASS_BASE_IVirtualInputer: {
                    libClassGroup[index] = new HLClassIVirtualInputer(this);
                    break;
                }
                case LIB_CLASS_BASE_List: {
                    libClassGroup[index] = new HLClassList(this);
                    break;
                }
                case LIB_CLASS_BASE_Loading: {
                    libClassGroup[index] = new HLClassLoading(this);
                    break;
                }
                case LIB_CLASS_BASE_Lock: {
                    libClassGroup[index] = new HLClassLock(this);
                    break;
                }
                case LIB_CLASS_BASE_Long: {
                    libClassGroup[index] = new HLClassLong(this);
                    break;
                }
                case LIB_CLASS_BASE_Math: {
                    libClassGroup[index] = new HLClassMath(this);
                    break;
                }
                case LIB_CLASS_BASE_MathFP: {
                    libClassGroup[index] = new HLClassMathFP(this);
                    break;
                }
                case LIB_CLASS_BASE_MD5: {
                    libClassGroup[index] = new HLClassMD5(this);
                    break;
                }
                case LIB_CLASS_BASE_Point: {
                    libClassGroup[index] = new HLClassPoint(this);
                    break;
                }
                case LIB_CLASS_BASE_Random: {
                    libClassGroup[index] = new HLClassRandom(this);
                    break;
                }
                case LIB_CLASS_BASE_Rectangle: {
                    libClassGroup[index] = new HLClassRectangle(this);
                    break;
                }
                case LIB_CLASS_BASE_Screen: {
                    libClassGroup[index] = new HLClassScreen(this);
                    break;
                }
                case LIB_CLASS_BASE_ShortList: {
                    libClassGroup[index] = new HLClassShortList(this);
                    break;
                }
                case LIB_CLASS_BASE_Size: {
                    libClassGroup[index] = new HLClassSize(this);
                    break;
                }
                case LIB_CLASS_BASE_SoundManager: {
                    libClassGroup[index] = new HLClassSoundManager(this);
                    break;
                }
                case LIB_CLASS_BASE_String: {
                    libClassGroup[index] = new HLClassString(this);
                    break;
                }
                case LIB_CLASS_BASE_Thread: {
                    libClassGroup[index] = new HLClassThread(this);
                    break;
                }
                case LIB_CLASS_BASE_Time: {
                    libClassGroup[index] = new HLClassTime(this);
                    break;
                }
                case LIB_CLASS_BASE_Util: {
                    libClassGroup[index] = new HLClassUtil(this);
                    break;
                }
                case LIB_CLASS_BASE_VirtualButton: {
                    libClassGroup[index] = new HLClassVirtualButton(this);
                    break;
                }
                case LIB_CLASS_BASE_VirtualPad: {
                    libClassGroup[index] = new HLClassVirtualPad(this);
                    break;
                }
                case LIB_CLASS_BASE_VirtualSlider: {
                    libClassGroup[index] = new HLClassVirtualSlider(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_CONTROL: {
                switch (index) {
                case LIB_CLASS_CONTROL_Label: {
                    libClassGroup[index] = new HLClassLabel(this);
                    break;
                }
                case LIB_CLASS_CONTROL_MessageBoxImage: {
                    libClassGroup[index] = new HLClassMessageBoxImage(this);
                    break;
                }
                case LIB_CLASS_CONTROL_NetWait: {
                    libClassGroup[index] = new HLClassNetWait(this);
                    break;
                }
                case LIB_CLASS_CONTROL_TextPage: {
                    libClassGroup[index] = new HLClassTextPage(this);
                    break;
                }
                case LIB_CLASS_CONTROL_TextPageOld: {
                    libClassGroup[index] = new HLClassTextPageOld(this);
                    break;
                }
                case LIB_CLASS_CONTROL_VScrollBar: {
                    libClassGroup[index] = new HLClassVScrollBar(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_DEVICE: {
                switch (index) {
                case LIB_CLASS_DEVICE_Device: {
                    libClassGroup[index] = new HLClassDevice(this);
                    break;
                }
                case LIB_CLASS_DEVICE_DeviceMotionItem: {
                    libClassGroup[index] = new HLClassDeviceMotionItem(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_GAME: {
                switch (index) {
                case LIB_CLASS_GAME_Camera: {
                    libClassGroup[index] = new HLClassCamera(this);
                    break;
                }
                case LIB_CLASS_GAME_CameraScaled: {
                    libClassGroup[index] = new HLClassCameraScaled(this);
                    break;
                }
                case LIB_CLASS_GAME_CD: {
                    libClassGroup[index] = new HLClassCD(this);
                    break;
                }
                case LIB_CLASS_GAME_CDGroupAllTrans: {
                    libClassGroup[index] = new HLClassCDGroupAllTrans(this);
                    break;
                }
                case LIB_CLASS_GAME_MapSprite: {
                    libClassGroup[index] = new HLClassMapSprite(this);
                    break;
                }
                case LIB_CLASS_GAME_SkillCommandManager: {
                    libClassGroup[index] = new HLClassSkillCommandManager(this);
                    break;
                }
                case LIB_CLASS_GAME_Sprite: {
                    libClassGroup[index] = new HLClassSprite(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteFrame: {
                    libClassGroup[index] = new HLClassSpriteFrame(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteInfo: {
                    libClassGroup[index] = new HLClassSpriteInfo(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteInfoManagerMesh: {
                    libClassGroup[index] = new HLClassSpriteInfoManagerMesh(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteInfoManagerOrder: {
                    libClassGroup[index] = new HLClassSpriteInfoManagerOrder(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteSeed: {
                    libClassGroup[index] = new HLClassSpriteSeed(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteSeedInfo: {
                    libClassGroup[index] = new HLClassSpriteSeedInfo(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteSeedManager: {
                    libClassGroup[index] = new HLClassSpriteSeedManager(this);
                    break;
                }
                case LIB_CLASS_GAME_SpriteUnit: {
                    libClassGroup[index] = new HLClassSpriteUnit(this);
                    break;
                }
                case LIB_CLASS_GAME_Tile: {
                    libClassGroup[index] = new HLClassTile(this);
                    break;
                }
                case LIB_CLASS_GAME_World: {
                    libClassGroup[index] = new HLClassWorld(this);
                    break;
                }
                case LIB_CLASS_GAME_WorldScaled: {
                    libClassGroup[index] = new HLClassWorldScaled(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_HANDFERE: {
                switch (index) {
                case LIB_CLASS_HANDFERE_Data: {
                    libClassGroup[index] = new HLClassData(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_HTTP: {
                switch (index) {
                case LIB_CLASS_HTTP_AHttpObjectFile: {
                    libClassGroup[index] = new HLClassAHttpObjectFile(this);
                    break;
                }
                case LIB_CLASS_HTTP_ANetFile: {
                    libClassGroup[index] = new HLClassANetFile(this);
                    break;
                }
                case LIB_CLASS_HTTP_FuckHttpClient: {
                    libClassGroup[index] = new HLClassFuckHttpClient(this);
                    break;
                }
                case LIB_CLASS_HTTP_FuckHttpContext: {
                    libClassGroup[index] = new HLClassFuckHttpContext(this);
                    break;
                }
                case LIB_CLASS_HTTP_HttpClient: {
                    libClassGroup[index] = new HLClassHttpClient(this);
                    break;
                }
                case LIB_CLASS_HTTP_HttpClientDownloadFile: {
                    libClassGroup[index] = new HLClassHttpClientDownloadFile(this);
                    break;
                }
                case LIB_CLASS_HTTP_HttpClientUploadFile: {
                    libClassGroup[index] = new HLClassHttpClientUploadFile(this);
                    break;
                }
                case LIB_CLASS_HTTP_HttpObject: {
                    libClassGroup[index] = new HLClassHttpObject(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_IO: {
                switch (index) {
                case LIB_CLASS_IO_AsynchronousLoadManager: {
                    libClassGroup[index] = new HLClassAsynchronousLoadManager(this);
                    break;
                }
                case LIB_CLASS_IO_File: {
                    libClassGroup[index] = new HLClassFile(this);
                    break;
                }
                case LIB_CLASS_IO_Package: {
                    libClassGroup[index] = new HLClassPackage(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_JSON: {
                switch (index) {
                case LIB_CLASS_JSON_JSONArray: {
                    libClassGroup[index] = new HLClassJSONArray(this);
                    break;
                }
                case LIB_CLASS_JSON_JSONObject: {
                    libClassGroup[index] = new HLClassJSONObject(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_MAP: {
                switch (index) {
                case LIB_CLASS_MAP_Error: {
                    libClassGroup[index] = new HLClassError(this);
                    break;
                }
                case LIB_CLASS_MAP_Location: {
                    libClassGroup[index] = new HLClassLocation(this);
                    break;
                }
                case LIB_CLASS_MAP_LocationManager: {
                    libClassGroup[index] = new HLClassLocationManager(this);
                    break;
                }
                case LIB_CLASS_MAP_MKMap: {
                    libClassGroup[index] = new HLClassMKMap(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_NOTIFICTION: {
                switch (index) {
                case LIB_CLASS_NOTIFICTION_LocalAndPushNotifiction: {
                    libClassGroup[index] = new HLClassLocalAndPushNotifiction(this);
                    break;
                }
                case LIB_CLASS_NOTIFICTION_ToDoItem: {
                    libClassGroup[index] = new HLClassToDoItem(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_PLATFORM: {
                switch (index) {
                case LIB_CLASS_PLATFORM_91PayInfo: {
                    libClassGroup[index] = new HLClass91PayInfo(this);
                    break;
                }
                case LIB_CLASS_PLATFORM_91Platform: {
                    libClassGroup[index] = new HLClass91Platform(this);
                    break;
                }
                case LIB_CLASS_PLATFORM_91Player: {
                    libClassGroup[index] = new HLClass91Player(this);
                    break;
                }
                case LIB_CLASS_PLATFORM_91Product: {
                    libClassGroup[index] = new HLClass91Product(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_PURCHASE: {
                switch (index) {
                case LIB_CLASS_PURCHASE_ADBannerManager: {
                    libClassGroup[index] = new HLClassADBannerManager(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_ADMob: {
                    libClassGroup[index] = new HLClassADMob(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_ADWallManager: {
                    libClassGroup[index] = new HLClassADWallManager(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_EGame: {
                    libClassGroup[index] = new HLClassEGame(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_IADBanner: {
                    libClassGroup[index] = new HLClassIADBanner(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_IAdWall: {
                    libClassGroup[index] = new HLClassIAdWall(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_Message: {
                    libClassGroup[index] = new HLClassMessage(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_MMMessage: {
                    libClassGroup[index] = new HLClassMMMessage(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_Product: {
                    libClassGroup[index] = new HLClassProduct(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_Purchase: {
                    libClassGroup[index] = new HLClassPurchase(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_Tapjoy: {
                    libClassGroup[index] = new HLClassTapjoy(this);
                    break;
                }
                case LIB_CLASS_PURCHASE_Transaction: {
                    libClassGroup[index] = new HLClassTransaction(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_SOCIAL: {
                switch (index) {
                case LIB_CLASS_SOCIAL_3rdPartyFriend: {
                    libClassGroup[index] = new HLClass3rdPartyFriend(this);
                    break;
                }
                case LIB_CLASS_SOCIAL_3rdPartyPlayer: {
                    libClassGroup[index] = new HLClass3rdPartyPlayer(this);
                    break;
                }
                case LIB_CLASS_SOCIAL_GameCenter: {
                    libClassGroup[index] = new HLClassGameCenter(this);
                    break;
                }
                case LIB_CLASS_SOCIAL_GCAchievement: {
                    libClassGroup[index] = new HLClassGCAchievement(this);
                    break;
                }
                case LIB_CLASS_SOCIAL_Social: {
                    libClassGroup[index] = new HLClassSocial(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_SOCKET: {
                switch (index) {
                case LIB_CLASS_SOCKET_SocketClient: {
                    libClassGroup[index] = new HLClassSocketClient(this);
                    break;
                }
                case LIB_CLASS_SOCKET_SocketObject: {
                    libClassGroup[index] = new HLClassSocketObject(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_UI: {
                switch (index) {
                case LIB_CLASS_UI_UI: {
                    libClassGroup[index] = new HLClassUI(this);
                    break;
                }
                case LIB_CLASS_UI_UIControl: {
                    libClassGroup[index] = new HLClassUIControl(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlButton: {
                    libClassGroup[index] = new HLClassUIControlButton(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlFrame: {
                    libClassGroup[index] = new HLClassUIControlFrame(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlImage: {
                    libClassGroup[index] = new HLClassUIControlImage(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlImageEX: {
                    libClassGroup[index] = new HLClassUIControlImageEX(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlImageFill: {
                    libClassGroup[index] = new HLClassUIControlImageFill(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlImageFillEX: {
                    libClassGroup[index] = new HLClassUIControlImageFillEX(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlLabel: {
                    libClassGroup[index] = new HLClassUIControlLabel(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlLine: {
                    libClassGroup[index] = new HLClassUIControlLine(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlRect: {
                    libClassGroup[index] = new HLClassUIControlRect(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlRim: {
                    libClassGroup[index] = new HLClassUIControlRim(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlScale9Grid: {
                    libClassGroup[index] = new HLClassUIControlScale9Grid(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlSprite: {
                    libClassGroup[index] = new HLClassUIControlSprite(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlText: {
                    libClassGroup[index] = new HLClassUIControlText(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlTextEX: {
                    libClassGroup[index] = new HLClassUIControlTextEX(this);
                    break;
                }
                case LIB_CLASS_UI_UIControlTextPage: {
                    libClassGroup[index] = new HLClassUIControlTextPage(this);
                    break;
                }
                case LIB_CLASS_UI_UIFrame: {
                    libClassGroup[index] = new HLClassUIFrame(this);
                    break;
                }
                case LIB_CLASS_UI_UIFrameImageList: {
                    libClassGroup[index] = new HLClassUIFrameImageList(this);
                    break;
                }
                case LIB_CLASS_UI_UISeed: {
                    libClassGroup[index] = new HLClassUISeed(this);
                    break;
                }
                case LIB_CLASS_UI_UISeedManager: {
                    libClassGroup[index] = new HLClassUISeedManager(this);
                    break;
                }
                }
                break;
            }
            case CLASS_GROUP_TYPE_LIB_USERCONTROL: {
                switch (index) {
                case LIB_CLASS_USERCONTROL_AchievementItem: {
                    libClassGroup[index] = new HLClassAchievementItem(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_AchievementList: {
                    libClassGroup[index] = new HLClassAchievementList(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_Base64: {
                    libClassGroup[index] = new HLClassBase64(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_BBS: {
                    libClassGroup[index] = new HLClassBBS(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_Challenge: {
                    libClassGroup[index] = new HLClassChallenge(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_ExchangeItem: {
                    libClassGroup[index] = new HLClassExchangeItem(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_ExchangeMoney: {
                    libClassGroup[index] = new HLClassExchangeMoney(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_HandfereMenu: {
                    libClassGroup[index] = new HLClassHandfereMenu(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_RechargePanel: {
                    libClassGroup[index] = new HLClassRechargePanel(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_ShareApp: {
                    libClassGroup[index] = new HLClassShareApp(this);
                    break;
                }
                case LIB_CLASS_USERCONTROL_TextField: {
                    libClassGroup[index] = new HLClassTextField(this);
                    break;
                }
                }
                break;
            }
            }
        }
        return libClassGroup[index];
    }

    public HLClass GetCustomClass(int index) {
        // if (index >= CustomClassGroup.length) {
        // HLCustomClass[] newCustomClassGroup = new HLCustomClass[index + 1];
        // System.arraycopy(CustomClassGroup, 0, newCustomClassGroup, 0,
        // CustomClassGroup.length);
        // CustomClassGroup = newCustomClassGroup;
        // }
        //
        // if (CustomClassGroup[index] == null) {
        // CustomClassGroup[index] = new HLCustomClass(this, index);
        // CustomClassGroup[index].Load(index);
        // }

        return CustomClassGroup[index];
    }

    public HLClass GetClass(int libIndex, int classIndex) {
        return libIndex >= 0 ? GetLibClass(libIndex, classIndex) : GetCustomClass(classIndex);
    }

    public HLObject NewObject(int libIndex, int classIndex) {
        return (libIndex >= 0 ? GetLibClass(libIndex, classIndex) : GetCustomClass(classIndex)).NewObject();
    }
}
